<template>
  <view>
    <u-popup :show="show"  mode="bottom"  :round="10" bgColor="#F6F7FB">
       <view class="popDialog">
         <view class="flex">
           <text class="c-95" @click="close()">取消</text>
           <view class="font-32 text-bold title flex-1">选择退款原因</view>
           <text class="color-title2" @click="confirm()">确定</text>
         </view>
          <scroll-view scroll-y="true" class="scrollH">
            <view class="time" :class="current==index?'on':''" v-for="(item,index) in list" :key="index" @click="current = index">{{item}}</view>
          </scroll-view>
       </view>
     </u-popup>
  </view>
</template>

<script>
  export default {
    name:"refundReason",
    props: {
      show: {
        type: Boolean,
        default: false
      },
      list: {
        type: Array,
        default: []
      }
    },
    data() {
      return {
        current: 0,
      };
    },
    methods: {
      close() {
        this.$emit("close")
      },
      confirm() {
        this.$emit("confirm",this.list[this.current])
      },
    }
  }
</script>

<style lang="scss" scoped>
.popDialog {
  width: 100%;
  padding: 40rpx 30rpx;
  border-radius: 20rpx 20rpx 0 0;
  box-sizing: border-box;
  .title {
    text-align: center;
  }
  .scrollH {
    height: 400rpx;
    margin-top: 80rpx;
    margin-bottom: 40rpx;
    
    .time {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 75rpx;
      border-radius: 20rpx;
      margin-bottom: 30rpx;
      background-color: #fff;
      color: #5F6680;
    }
    .on {
      color: #fff!important;
      background-color: $color-title2!important;
    }
  }
}
</style>